package 过滤器模式;

import java.util.LinkedList;
import java.util.List;

public class TestMain {

    public static void main(String[] args) {

        List<Person> objects = new LinkedList<>();

        for (int i = 0; i < 10; i++) {
            if (i <5) {
                objects.add(new Person(String.valueOf(i),"男"));
            } else {
                objects.add(new Person(String.valueOf(i),"女"));
            }
        }

        BoylFilter boylFilter = new BoylFilter();
        List<Person> filter = boylFilter.filter(objects);
        filter.forEach(person -> System.out.println(person.toString()));
    }
}
